﻿<UserControl x:Class="ThumbGen.LoadingScreen"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:ThumbGen"
    xmlns:sys="clr-namespace:System;assembly=mscorlib"
    x:Name="TopControl">
    <UserControl.Resources>
        <ResourceDictionary>

        </ResourceDictionary>
    </UserControl.Resources>
    <Grid x:Name="MainGrid" DataContext="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type UserControl}}}"
          VerticalAlignment="Center" Height="{Binding ElementName=TopControl,Path=ActualHeight}">
        <Rectangle Fill="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type UserControl}},Path=CustomBackground}" 
                   HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Opacity="0.7"/>
        <StackPanel Orientation="Vertical" VerticalAlignment="Center">
            <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
                <ContentControl Margin="20" VerticalAlignment="Center">
                    <local:SimpleSpinner Opacity="1"/>
                </ContentControl>
                <TextBlock FontSize="14" FontWeight="Bold" Opacity="1"
                       Foreground="Navy" 
                       VerticalAlignment="Center"
                       Text="{Binding CustomMessage}">
                </TextBlock>
            </StackPanel>
            <Button x:Name="CancelSearchButton" MinWidth="170" HorizontalAlignment="Center" Opacity="1"
                    Content="{Binding CustomAbortButtonText}" Click="Button_Click" Margin="0 10 0 0" VerticalAlignment="Center"/>
        </StackPanel>
    </Grid>
</UserControl>
